package com.hackerrank.challenges.eventree;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.TreeSet;

public class Solution {
	private static class Node implements Comparable<Node> {
		int n, c;
		List<Integer> cn = new ArrayList<Integer>();
		public Node(int n) {
			this.n = n;
		}
		@Override
		public int compareTo(Node node) {
			if(cn.size() != node.cn.size())
				return cn.size() - node.cn.size();
			return n - node.n;
		}
		public String toString() {
			return "{" + n + ", " + c + ", " + cn + "}";
		}
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt(), M = in.nextInt(), d = 0;
		Node n[] = new Node[N + 1];
		TreeSet<Node> t = new TreeSet<Node>();
		for(int i = 0; i < n.length; i++)
			n[i] = new Node(i);
		for(int i = 0; i < M; i++) {
			int n1 = in.nextInt(), n2 = in.nextInt();
			n[n1].cn.add(n2);
			n[n2].cn.add(n1);
		}
		for(int i = 1; i < n.length; i++)
			t.add(n[i]);
		Node f = t.pollFirst();
		while(f != null && f.cn.size() > 0) {
			t.remove(n[f.cn.get(0)]);
			n[f.cn.get(0)].cn.remove((Integer)f.n);
			// cannot remove edge to parent node
			if(f.c % 2 == 0)
				n[f.cn.get(0)].c++;
			else
				d++;
			t.add(n[f.cn.get(0)]);
			f = t.pollFirst();
		}
		System.out.println(d);
	}
}
